<?php
/*
 * @Author: Terry
 * @Date: 2025-03-20 17:33:28
 * @LastEditors: Terry
 * @LastEditTime: 2025-03-27 21:44:53
 * @Description: file content
 * @FilePath: \yyd_api\route\app.php
 */
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

//后台管理路由api
Route::group('admin/v1/', function () {
});

//前台路由api
Route::group('user/v1/', function () {
    //获取首页数据
    Route::get('index/getHomeData', 'index/getHomeData')->middleware('checkLogin');//获取首页数据
    //运营概览
    Route::group("auth/", function () {
            Route::group("", function () {
                Route::post('savePhone', 'auth/savePhone');//小程序保存手机号码
                Route::post('authorization', 'auth/authorization');//用户授权信息保存
                Route::post('register', 'auth/register');//会员注册
                Route::post('companyAuth', 'auth/companyAuth');//企业认证
            })->middleware('checkLogin');     
        Route::get('login', 'auth/login'); //登录
    });

    //项目管理
    Route::group("project/", function () {
        Route::get('getList', 'project/getList');//获取项目列表
        Route::get('getDetail', 'project/getDetail');//获取项目详情
        Route::post('save', 'project/save');//保存项目（创建/更新）
        Route::delete('delete', 'project/delete');//删除项目
        Route::get('getListOptions', 'project/getListOptions');//获取列表选项
        Route::get('getOptions', 'project/getOptions');//获取所有选项
    })->middleware('checkLogin'); 

    //获取联系方式
    Route::group("contact/", function () {
        Route::get('getDetail', 'contact/getDetail');//获取联系方式详情
    });

    //获取订单
    Route::group("order/", function () {
        Route::get('getList', 'order/getList');//获取订单列表
        Route::get('getDetail', 'order/getDetail');//获取订单详情
        Route::get('getDetailImage', 'order/getDetailImage');//获取订单详情的图片
        Route::get('getOptions', 'order/getOptions');//获取订单选项
    })->middleware('checkLogin');

    //我的
    Route::group("mine/", function () {
        Route::get('getInfo', 'mine/getInfo');//获取个人信息
        Route::get('getDetail', 'mine/getDetail');//获取用户详细信息
        Route::post('save', 'mine/save');//保存用户信息
    })->middleware('checkLogin');
    
    //通用功能
    Route::group("common/", function () {
        Route::post('uploadImg', 'common/uploadImg');//文件上传
    })->middleware('checkLogin');
})->prefix('user.v1.')->middleware('checkData');
 